Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto select first device when there is no selection yet #7971

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Lootwig
Copy link
Contributor

@Lootwig Lootwig commented Mar 14, 2025

This change automates the requirement to manually select a device, currently a mandatory manual step when not running from the command line (flutter run is capable of autonomously selecting a matching device)

Fixes #7970.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read the [Flutter Style Guide] recently, and have followed its advice.
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@AlexV525
Copy link
Member

(Personal suggestion) Since there is no test in the PR, could you attach a screen recording of how it runs?

@jwren
Copy link
Member

jwren commented Apr 10, 2025

@Lootwig --- thanks for the PR and sorry for the delay. Choosing the first option in the list is a good idea, and probably better than doing nothing, which is what we currently do, however what is the ordering of this list? Shouldn't we be opinionated about which type of run configuration, i.e. when getting started I always choose "Web" as I always have chrome open and on my machine, but perhaps this is wrong for the average Flutter developer.

@AlexV525
Copy link
Member

AlexV525 commented Apr 11, 2025

perhaps this is wrong for the average Flutter developer.

I'd prefer to choose the last time I've selected if it is available, then the first in the list.

@Lootwig
Copy link
Contributor Author

Lootwig commented Apr 12, 2025

@Lootwig --- thanks for the PR and sorry for the delay. Choosing the first option in the list is a good idea, and probably better than doing nothing, which is what we currently do, however what is the ordering of this list? Shouldn't we be opinionated about which type of run configuration, i.e. when getting started I always choose "Web" as I always have chrome open and on my machine, but perhaps this is wrong for the average Flutter developer.

while the ordering might even follow some semi-predictable pattern depending on how the different platforms are being detected, I believe the need for an (immediate) customization is overshooting the target. The majority of use cases (?) involves the dev launching their target platform as part of their workflow, either manually or via startup task in the IDE - both of which are enough to trigger the plugin's detection of a "newly arrived" platform resulting in the convenient auto-selection.

Yes, this implementation may introduce a new group of users, deploying between 7-58 build targets at the same time to the concept of "people usually don't have to click this button every time, you know".. doesn't sound like a bad problem to have, though ^^

Edit: in a way, this PR is a result of the OS platform being too easy to target, considering the extra components usually required for running a flutter app on web or one of the mobile platforms :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Run" widget is unable to pick suitable device (like flutter run does)
3 participants